﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="SelectItemsForPurchasing.aspx.cs" Inherits="PresentationLayer.SelectItemsForPurchasing" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1
        {
            width: 75px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <div align="center">
            <h2>Select Items for Purchasing</h2>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <br />
                    <table width="50%">
                        <tr>
                            <td>
                                <fieldset>
                                    <legend>Filter By</legend>
                                    <table align="center">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblCategory" runat="server" Text="Category"></asp:Label>
                                                </td>
                                            <td>
                                                <asp:DropDownList ID="ddlCategory" runat="server" CssClass="form-control" Width="115px"></asp:DropDownList>
                                            </td>
                                            <td class="auto-style1">&nbsp;</td>
                                            <td>
                                                <asp:CheckBox ID="cboLowStock" runat="server" Text="View Only Low Stock Items" CssClass="checkbox" Width="207px" />
                                            </td>
                                            <td>
                                                <asp:Button ID="btnFilter" runat="server" Text="Filter" OnClick="btnFilter_Click" CssClass="btn-info" />
                                                </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <hr />                    
                    <br />
                    <asp:GridView ID="gvStationery" runat="server" AutoGenerateColumns="False" OnPageIndexChanged="gvStationery_PageIndexChanged" OnPageIndexChanging="gvStationery_PageIndexChanging" AllowPaging="True" PageSize="5" CssClass="table table-hover table-striped table-bordered" width="90%" PagerStyle-HorizontalAlign="Center" PagerSettings-Visible="True" PagerStyle-VerticalAlign="Middle" PagerStyle-BorderStyle="NotSet">
                        <Columns>
                            <asp:TemplateField HeaderText="Item Code" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblItemCode" runat="server" Text='<%#Eval("ItemCode") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Item Name">
                                <ItemTemplate>
                                    <asp:Label ID="lblItemNameGV" runat="server" Text='<%#Eval("ItemName") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Category">
                                <ItemTemplate>
                                    <asp:Label ID="lblCategoryGV" runat="server" Text='<%#Eval("Category") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Reorder Level">
                                <ItemTemplate>
                                    <asp:Label ID="lblReorderLevelGV" runat="server" Text='<%#Eval("ReorderLevel") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Reorder Quantity">
                                <ItemTemplate>
                                    <asp:Label ID="lblReorderQuantityGV" runat="server" Text='<%#Eval("ReorderQuantity") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Unit of Measurement">
                                <ItemTemplate>
                                    <asp:Label ID="lblUOMGV" runat="server" Text='<%#Eval("UnitOfMeasurement") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Available Quantity">
                                <ItemTemplate>
                                    <asp:Label ID="lblAvailableQtyGV" runat="server" Text='<%#Eval("AvailableQuantity") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Supplier Detail">
                                <ItemTemplate>
                                    <asp:Button ID="btnSupplierDetail" runat="server" Text="Supplier Detail" OnClick="btnSupplierDetail_Click" />
                                </ItemTemplate>
                                <ControlStyle CssClass="btn-info" />
                            </asp:TemplateField>
                        </Columns>
                        <AlternatingRowStyle CssClass="alt" />
                        <PagerSettings Mode="NextPreviousFirstLast" NextPageText="Next&amp;nbsp;" PreviousPageText="Previous&amp;nbsp;" FirstPageText="First&amp;nbsp;" LastPageText="Last" />
                        <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:GridView>
                    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
                    <br />
                    <br />
                    <asp:Label ID="lblItemName" runat="server" Font-Bold="True"></asp:Label>
                    <br />
                    <asp:GridView ID="gvSupplier" runat="server" AutoGenerateColumns="False" CssClass="table table-hover table-striped table-bordered" width="90%">
                        <Columns>
                            <asp:TemplateField HeaderText="Item Code" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblItemCodeGVSup" runat="server" Text='<%#Eval("ItemCode") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Item Code" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblItemNameGVSup" runat="server" Text='<%#Eval("ItemName") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Supplier Detail Id" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblSupplierDetailIdGVSup" runat="server" Text='<%#Eval("SupplierDetailId") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Supplier Id" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblSupplierIdGVSup" runat="server" Text='<%#Eval("SupplierId") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Rank">
                                <ItemTemplate>
                                    <asp:Label ID="lblRankGVSup" runat="server" Text='<%#Eval("Rank") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Supplier Name">
                                <ItemTemplate>
                                    <asp:Label ID="lblSupplierNameGVSup" runat="server" Text='<%#Eval("SupplierName") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contact No.">
                                <ItemTemplate>
                                    <asp:Label ID="lblContactNoGVSup" runat="server" Text='<%#Eval("ContactNo") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Unit Price (S$)">
                                <ItemTemplate>
                                    <asp:Label ID="lblPriceGVSup" runat="server" Text='<%#Eval("Price") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Add to Purchase Order">
                                <ItemTemplate>
                                    <asp:Button ID="btnAddToPO" runat="server" Text="Add to Purchase Order" OnClick="btnAddToPO_Click" />
                                </ItemTemplate>
                                <ControlStyle CssClass="btn-primary" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <br />
                    <asp:Button ID="btnRaisePO" runat="server" Text="Proceed to Raise Purchase Order List" OnClick="btnRaisePO_Click" CssClass="btn" />
                </ContentTemplate>
            </asp:UpdatePanel>
            <br />
            <br />
        </div>
</asp:Content>
